﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmRegistrarCliente.aspx.cs" Inherits="Farmacia.net.Ventas.Cliente.frmRegistrarCliente" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Registrar Cliente</h2>

<fieldset>
    <legend> <b>Nuevo Cliente</b></legend>

    <asp:FormView ID="fvNuevo" runat="server" BackColor="#DEBA84" 
        BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
        CellSpacing="2" DataSourceID="odsNuevoCliente" DefaultMode="Insert" 
        GridLines="Both">
        <EditItemTemplate>
            <table class="style1">
                <tr>
                    <td>
                        IdCliente:</td>
                    <td>
                        <asp:TextBox ID="IdClienteTextBox" runat="server" 
                            Text='<%# Bind("IdCliente") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        RucDni:</td>
                    <td>
                        <asp:TextBox ID="RucDniTextBox" runat="server" Text='<%# Bind("RucDni") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        RazonSocial:
                    </td>
                    <td>
                        <asp:TextBox ID="RazonSocialTextBox" runat="server" 
                            Text='<%# Bind("RazonSocial") %>' Width="300px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Direccion:</td>
                    <td>
                        <asp:TextBox ID="DireccionTextBox" runat="server" 
                            Text='<%# Bind("Direccion") %>' Width="300px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Actualizar" />
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
                    </td>
                </tr>
            </table>
        </EditItemTemplate>
        <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
        <InsertItemTemplate>
            <table class="style1">
                <tr>
                    <td>
                        IdCliente:</td>
                    <td>
                        <asp:TextBox ID="IdClienteTextBox" runat="server" 
                            Text='<%# Bind("IdCliente") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        RucDni:</td>
                    <td>
                        <asp:TextBox ID="RucDniTextBox" runat="server" Text='<%# Bind("RucDni") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        RazonSocial:
                    </td>
                    <td>
                        <asp:TextBox ID="RazonSocialTextBox" runat="server" 
                            Text='<%# Bind("RazonSocial") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Direccion:</td>
                    <td>
                        <asp:TextBox ID="DireccionTextBox" runat="server" 
                            Text='<%# Bind("Direccion") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                            CommandName="Insert" Text="Insertar" />
                        &nbsp;
                        <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Cancelar" />
                    </td>
                </tr>
            </table>
        </InsertItemTemplate>
        <ItemTemplate>
            IdCliente:
            <asp:Label ID="IdClienteLabel" runat="server" Text='<%# Bind("IdCliente") %>' />
            <br />
            RucDni:
            <asp:Label ID="RucDniLabel" runat="server" Text='<%# Bind("RucDni") %>' />
            <br />
            RazonSocial:
            <asp:Label ID="RazonSocialLabel" runat="server" 
                Text='<%# Bind("RazonSocial") %>' />
            <br />
            Direccion:
            <asp:Label ID="DireccionLabel" runat="server" Text='<%# Bind("Direccion") %>' />
            <br />
            Cotizacion:
            <asp:Label ID="CotizacionLabel" runat="server" 
                Text='<%# Bind("Cotizacion") %>' />
            <br />
            Pedido:
            <asp:Label ID="PedidoLabel" runat="server" Text='<%# Bind("Pedido") %>' />
            <br />
            <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="Eliminar" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="Nuevo" />
        </ItemTemplate>
        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
    </asp:FormView>

    <asp:ObjectDataSource ID="odsNuevoCliente" runat="server" 
        DataObjectTypeName="Farmacia.Entities.Cliente" DeleteMethod="DeleteCliente" 
        InsertMethod="RegistrarCliente" 
        onobjectcreating="odsNuevoCliente_ObjectCreating" 
        SelectMethod="GetFromClienteById" 
        TypeName="Farmacia.BussinessLogic.ClienteBL" 
        ondeleted="odsNuevoCliente_Deleted" UpdateMethod="RegistrarCliente" 
        oninserted="odsNuevoCliente_Inserted" onupdated="odsNuevoCliente_Updated">
        <DeleteParameters>
            <asp:QueryStringParameter Name="id" QueryStringField="idCliente" Type="Int32" />
        </DeleteParameters>
        <SelectParameters>
            <asp:QueryStringParameter Name="id" QueryStringField="idCliente" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</fieldset>

</asp:Content>
